package edu.ycu.aladdin.web.api.data;

import edu.ycu.aladdin.web.aspect.NeedLogin;
import edu.ycu.aladdin.web.common.RestResponse;
import edu.ycu.aladdin.web.controller.AbsController;
import edu.ycu.aladdin.web.dto.DataLabel;
import org.springframework.web.bind.annotation.*;

/**
 * @author <a href="mailto:wangruihuano@gmail.com">王瑞环</a>
 * @since 2019-04-02 14:16
 */
public interface DataAPI {

    /**
     * 标注数据
     * @param label
     * @param sso
     * @see DataLabel
     * @return
     */
    @NeedLogin
    @RequestMapping(value = "/lable",method = RequestMethod.POST)
    RestResponse labelData(@RequestBody DataLabel label, @CookieValue(AbsController.COOKIE_LOGIN_KEY) String sso);

    /**
     * 给定日期范围获取汇率
     * @param start 开始日期
     * @param end 结束日期
     * @return
     */
    @RequestMapping(value = "/rate",method = RequestMethod.GET)
    RestResponse getByDate(@RequestParam("start") String start, @RequestParam("end") String end);
}
